from django.utils.deprecation import MiddlewareMixin


class TestMiddleware(MiddlewareMixin):
    def process_request(self,request):
        print('拿到之前')
    def process_view(self,request,view_func,view_args,view_kwargs):
        print('执行视图前')
    def process_template_response(self,request,response):
        print('模板渲染前')
        return response
    def process_exception(self,request,exception):
        print('异常后')
    def process_response(self,request,response):
        print('拿到之后')
        return response







